<template>
  <div class='swiperContainer'>
    <swiper :options='swiperOption' v-if='ShowSiper'>
      <swiper-slide v-for='item of swiperlist' :key='item.id'>
        <img class='item-img' :src='item.imgUrl' />
      </swiper-slide>

      <div class='swiper-pagination' slot='pagination'></div>
    </swiper>
  </div>
</template>
<script>
export default {
  data () {
    return {
      swiperOption: {
        loop: true,
        pagination: '.swiper-pagination',
        autoplay: 3000
      }
    };
  },
  props: ['swiperlist'],
  computed: {
    ShowSiper () {
      return this.swiperlist.length
    }
  }
}
</script>
<style lang='less' >
.item-img {
  width: 100%;
}
.swiperContainer {
  overflow: hidden;
  width: 100%;
  height: 0;
  padding-bottom: 31.25%;
  background: #fff;
}
.swiper-pagination-bullet-active {
  background: #fff;
}
</style>

